﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication3
{
    public static class Calculator
    {
        public static string Calculate(int a, int b, char operation)
        {
            int result = 0;

            if (operation == (char)'+')
            {
                result = a + b;
            }
            else if (operation == (char)'-')
            {
                result = a - b;
            }

            else if (operation == (char)'*')
            {
                result = a * b;
            }

            else if (operation == (char)'/')
            {
                if (b == 0) throw new DivideByZeroException("DivideByZeroException");
                result = a / b;
            }

            return result.ToString();
        }
    }
}
